package com.xiaochun.jiankangapp.utils

import android.content.Context
import android.widget.ImageView
import com.bumptech.glide.Glide
import com.bumptech.glide.request.target.Target
import com.luck.picture.lib.engine.ImageEngine

object GlideEngine : ImageEngine {
    override fun loadImage(context: Context, url: String?, imageView: ImageView) {
        Glide.with(context).load(url).into(imageView)
    }

    override fun loadImage(
        context: Context,
        imageView: ImageView,
        url: String?,
        maxWidth: Int,
        maxHeight: Int
    ) {
        Glide.with(context).load(url).override(Target.SIZE_ORIGINAL).into(imageView)
    }

    override fun loadAlbumCover(context: Context, url: String?, imageView: ImageView) {
        Glide.with(context).load(url).into(imageView)
    }

    override fun loadGridImage(context: Context, url: String?, imageView: ImageView) {
        Glide.with(context).load(url).into(imageView)
    }

    override fun pauseRequests(context: Context) {
        Glide.with(context).pauseRequests()
    }

    override fun resumeRequests(context: Context) {
        Glide.with(context).resumeRequests()
    }
}